{% extends "base.html" %}
{% from "macros.jinja" import print_flash_messages %}
{% block body %}

<div id="wrapper">

  <!-- Sidebar -->
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{{ url_for('index') }}">SaltPad</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse navbar-ex1-collapse">
      <ul class="nav navbar-nav side-nav">
        <li class="active"><a href="{{ url_for('index') }}"><i class="fa fa-fw fa-dashboard fa-lg"></i> Dashboard</a></li>

        <li>
            <a href="javascript:;" data-toggle="collapse" data-target="#minions-ul" class="" aria-expanded="true"><i class="fa fa-fw fa-users fa-lg"></i> Minions <i class="fa fa-fw fa-caret-down"></i></a>
            <ul class="collapse"id="minions-ul">
              <li><a href="{{ url_for('minions_status') }}"><i class="fa fa-check-square fa-fw fa-lg"></i> Minions sync status</a></li>
              <li><a href="{{ url_for('minions_deployments') }}"><i class="fa fa-rocket fa-fw fa-lg"></i> Minions deployments</a></li>
              <li><a href="{{ url_for('wip') }}"><i class="fa fa-plus-square fa-fw fa-lg"></i> HealthChecks</a></li>
              <li><a href="{{ url_for('minions_keys') }}"><i class="fa fa-key fa-fw fa-lg"></i> Minions keys</a></li>
            </ul>
        </li>

        <li>
            <a href="javascript:;" data-toggle="collapse" data-target="#jobs-ul" class="" aria-expanded="true"><i class="fa fa-tasks fa-fw fa-lg"></i> Jobs <i class="fa fa-fw fa-caret-down"></i></a>
            <ul class="collapse"id="jobs-ul">
              <li><a href="{{ url_for('templates') }}"><i class="fa fa-magic fa-fw fa-lg"></i> Templates</a></li>
              <li><a href="{{ url_for('jobs') }}"><i class="fa fa-history fa-fw fa-lg"></i> Jobs history</a></li>
              <li><a href="{{ url_for('wip') }}"><i class="fa fa-retweet fa-fw fa-lg"></i> Scheduled Jobs</a></li>
            </ul>
        </li>


        <li>
            <a href="javascript:;" data-toggle="collapse" data-target="#execute-ul" class="" aria-expanded="true"><i class="fa fa-play fa-fw fa-lg"></i> Execute <i class="fa fa-fw fa-caret-down"></i></a>
            <ul class="collapse"id="execute-ul">
              <li><a href="{{ url_for('run') }}"><i class="fa fa-terminal fa-fw fa-lg"></i> Run module</a></li>
              <li><a href="{{ url_for('wip') }}"><i class="fa fa-list-alt fa-fw fa-lg"></i> Inventory / Reporting</a></li>
            </ul>
        </li>

        <li>
            <a href="javascript:;" data-toggle="collapse" data-target="#debug-ul" class="" aria-expanded="true"><i class="fa fa-lightbulb-o fa-fw fa-lg"></i> Debug <i class="fa fa-fw fa-caret-down"></i></a>
            <ul class="collapse"id="debug-ul">
              <li><a href="{{ url_for('debug') }}"><i class="fa fa-code fa-fw fa-lg"></i> Debug minion</a></li>
            </ul>
        </li>
      </ul>

      <ul class="nav navbar-nav navbar-right navbar-user">
        <li class="dropdown messages-dropdown">
          <!-- <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-envelope"></i> Messages <span class="badge">7</span> <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li class="dropdown-header">7 New Messages</li>
            <li class="message-preview">
              <a href="#">
                <span class="avatar"><img src="http://placehold.it/50x50"></span>
                <span class="name">John Smith:</span>
                <span class="message">Hey there, I wanted to ask you something...</span>
                <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
              </a>
            </li>
            <li class="divider"></li>
            <li class="message-preview">
              <a href="#">
                <span class="avatar"><img src="http://placehold.it/50x50"></span>
                <span class="name">John Smith:</span>
                <span class="message">Hey there, I wanted to ask you something...</span>
                <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
              </a>
            </li>
            <li class="divider"></li>
            <li class="message-preview">
              <a href="#">
                <span class="avatar"><img src="http://placehold.it/50x50"></span>
                <span class="name">{{ session['username'] }}:</span>
                <span class="message">Hey there, I wanted to ask you something...</span>
                <span class="time"><i class="fa fa-clock-o"></i> 4:34 PM</span>
              </a>
            </li>
            <li class="divider"></li>
            <li><a href="#">View Inbox <span class="badge">7</span></a></li>
          </ul>
        </li>
        <li class="dropdown alerts-dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i> Alerts <span class="badge">3</span> <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">Default <span class="label label-default">Default</span></a></li>
            <li><a href="#">Primary <span class="label label-primary">Primary</span></a></li>
            <li><a href="#">Success <span class="label label-success">Success</span></a></li>
            <li><a href="#">Info <span class="label label-info">Info</span></a></li>
            <li><a href="#">Warning <span class="label label-warning">Warning</span></a></li>
            <li><a href="#">Danger <span class="label label-danger">Danger</span></a></li>
            <li class="divider"></li>
            <li><a href="#">View All</a></li>
          </ul>
        </li> -->
        <li class="dropdown user-dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> {{ session['username'] }} <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="{{ url_for('logout') }}"><i class="fa fa-power-off"></i> Log Out</a></li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </nav>

  <div id="page-wrapper">

    {{ print_flash_messages()|safe }}

    {% block page %}
    {% endblock %}

  </div><!-- /#page-wrapper -->

</div><!-- /#wrapper -->

{% endblock %}
